import os
CurrentDirectory = os.getcwd() + '/'

COOPGISDirectory="/opt/coopgis/coopgis/"
PythonPath = COOPGISDirectory + "djangoproject/"
COOPGISWSGIFile = PythonPath + '/django.wsgi'
COOPGISConfigDirectory="/opt/coopconfig/"
COOPGISConfigFileName = "coopgisconfig.py"




print "Dropping Current and Creating Test Database"
os.system("""createuser coopgis -s""")
#SQL to Alter the coopgis user and set the password to coopgis
os.system("""dropdb coopgis""")
os.system("""createdb coopgis""")
os.system("""createlang plpgsql coopgis""")
os.system("""psql -d coopgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql""")
os.system("""psql -d coopgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql""")

os.system("""psql -d coopgis -f /usr/share/postgresql/9.1/contrib/postgis_comments.sql""")





#Response = raw_input().lower()
#if('y' in Response):
#    os.system("""su -c "createuser root -s" postgres """)
#    os.system("""su -c "createuser technology -s" postgres""")
#    print "Enter a password for for the coopgisdbuser"
#    os.system("""su -c "createuser coopgisdbuser -s -P" postgres""")

#TODO Create a separate script for creating the database
#createdb coopgis








